/**
 * Created by chenshengli on 2015/7/2 0002.
 */

exports.fillParam = function (req, obj) {
    var params = req.params || {};
    var body = req.body || {};
    var query = req.query || {};
    obj = this.fill(obj, params);
    obj = this.fill(obj, body);
    obj = this.fill(obj, query);
    return obj;
}

exports.fill = function(des, src) {
    for (var i in src) {
        if (i in des) {
            des[i] = src[i];
        }
    }
    return des;
}